{literal}
<script type="text/javascript">$().ready(function(){$('#addProduct').validate();});</script>
{/literal}
<h1>Edytujesz produkt</h1>

<form method="post" enctype="multipart/form-data" id="addProduct">
	
{mainoptions title="Powiązany produkt"}
    
<table cellpadding="0" cellspacing="0" width="100%" class="commonTable">
		<tr>
			<th>Produkt</th>
			<td><select name="id_product">{foreach from=$products item=product}<option value="{$product->getId()}"{if $product->getId()==$obj->getIdProduct()} selected="selected"{/if}>{$product->getName()}</option>{/foreach}</select></td>
			
		</tr>


		

	</table>
        
{/mainoptions}        
{mainoptions title="Dane dla poszczególnych wersji językowych"}
	{assign var=class value=colapse}
	{foreach from=$languages item=lang}
        {assign var=description value=$obj->getDescription($lang->getid())}
	{capture assign=title}Dane języka: {$lang->getName()}{/capture}
	{mainoptions title=$title class=$class}
	<table cellpadding="0" cellspacing="0" width="100%" class="commonTable">
		<tr>
			<th>Nazwa</th>
			<td><input type="text" class="required" name="name[{$lang->getId()}]" value="{$description->getName()}" /></td>
		</tr>
	</table>
	{/mainoptions}
	{assign var=class value=expand}
	{assign var=required value=1}
	{/foreach}
{/mainoptions}

{mainoptions title="Dane ogólne"}
	<table cellpadding="0" cellspacing="0" width="100%" class="commonTable">
		
		
		<tr>
			<th>Aktywny:</th>
			<td>
				<input type="radio" {if $obj->getActive()=='1'}checked="checked"{/if} value="1" id="active_1" name="active" /><label for="active_1">tak</label>
				<input type="radio" {if $obj->getActive()=='0'}checked="checked"{/if} value="0" id="active_0"  name="active"  /><label for="active_0">nie</label>
			</td>
		</tr>
                
                <tr>
			<th>Cena:</th>
			<td>
				
				<input type="text" name="price" value="{$obj->getPrice()}" />
			</td>
		</tr>
                <tr>
			<th>Adres url produktu w sklepie:</th>
			<td>
				
				<input type="text" name="url" value="{$obj->getUrl()}" />
			</td>
		</tr>
		
		

	</table>

{/mainoptions}
{mainoptions}
	<input type="submit" value="Zapisz i przejdź do listy" />
	<input type="button" value="Anuluj" onclick="document.location='{url product=index}'" />
{/mainoptions}
</form>
